# Maintainer: Fabian Bornschein <fabiscafe-at-mailbox-dot-org>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Fabian Bornschein <fabiscafe-cat-mailbox-dog-org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Yosef Or Boczko <yoseforb@gnome.org>

pkgname=gnome-software
pkgver=45.1
pkgrel=2
pkgdesc="GNOME Software Tools"
url="https://wiki.gnome.org/Apps/Software/"
arch=(loong64 x86_64)
license=(GPL)
depends=(
  appstream
  gsettings-desktop-schemas
  gtk4
  libadwaita
  libsoup3
  libsysprof-capture
  libxmlb
  polkit
)
makedepends=(
  docbook-xsl
  flatpak
  fwupd
  git
  gobject-introspection
  gtk-doc
  libglib-testing
  malcontent
  meson
)
optdepends=(
  'flatpak: Flatpak support plugin'
  'fwupd: fwupd support plugin'
  'malcontent: Parental control plugin'
)
groups=(gnome)
_commit=b615e544ca5804eb660ea9b8e6d55485d2f6cc65  # tags/45.1^0
source=(
  "git+https://gitlab.gnome.org/GNOME/gnome-software.git#commit=$_commit"
  "git+https://gitlab.gnome.org/mwleeds/gnome-pwa-list.git"
  "appstream-1.0.patch"
)
b2sums=('SKIP'
        'SKIP'
        'a110ec8e08f1c952c3ccf64cede202206cc1cbf95ead1b6f6224e5c1fb9d393904703cce03a248520cc4221f8a2fe5c85ca8a37ff850ed6e3025bb174d69f724')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd $pkgname

  # support appstream 1.0
  patch -p1 < ../appstream-1.0.patch

  git submodule init
  git submodule set-url subprojects/gnome-pwa-list "$srcdir/gnome-pwa-list"
  git -c protocol.file.allow=always submodule update
}

build() {
  local meson_options=(
    -D packagekit=false
  )

  arch-meson $pkgname build "${meson_options[@]}"
  meson compile -C build
}

# Not running tests - need root and a D-Bus system bus

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
